home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
ring14d.zip
/
RING.DOC
< prev
next >
Wrap
Text File
|
1994-03-08
|
8KB
|
205 lines
RING, v1.4
-------------
from TifaWARE
What's New
----------
New to version 1.4 is support for DOS v4.0, v5.0, and v6.0. This
required a new approach to locating the ERRORLEVEL. Adding support for
other versions will be easy once the magic offsets are known.
With version 1.3 I have substantially reorganized RING's source code,
placing commonly-used procedures, equates, and macros in separate files.
Sharing code in this way will make it my programming task easier. From the
user's point of view, however, there should be no change in the program.
Version 1.2 introduces the '-e' option. If you're running DOS v3.30
you can use this option to sound a bell only when the previous program had
a non-zero return code; ie, exited with an error. This provides an ideal
way to tell users of problems when used in a batch file.
Many of the principal functions in RING have been completely
rewritten for version 1.1. These changes will make it easier for me to
revise the program. From the user's point of view, though, nothing has
changed.
Introduction
------------
PCs have brought about great strides in productivity, but one problem
has been a lack of multitasking features in MS-DOS. If you have a long job
to run, you not only tie up the computer but you also must glance at the
screen every once in a while to figure out if the job's finished. Either
that, or you risk leaving the computer idle because you don't know how
long the job will take. This is clearly inefficient.
RING provides a poor man's approach to multitasking. No, it doesn't
let you run two programs at the same time; instead, it merely rings the
console bell a few times. What's this got to do with multitasking, you
ask? It's quite simple - start your job in the usual fashion, type "RING",
and walk away. While your computer's doing one task, you're free to go
about another task. As soon as your job has finished, the PC's console
bell will sound, advising you it's ready for another job.
Usage
-----
Running this program is a breeze. Once you've placed RING.COM on your
system where DOS can find it, type RING -? to display a brief help message
similar to the following:
TifaWARE RING, v1.4a, 12/28/90 - rings the console bell.
Usage: ring [-options] [count]
Options:
-e = ring bell only if errorlevel is non-zero
-? = display this help message
count denotes a repetition count and must be between 0 and 15.
The default value of count is 3.
[If you don't remember anything else, at least remember how to display
this help message.]
Normally, you'll invoke RING without any arguments, and the console
bell will sound three times. This is probably fine in most situations.
However, RING also allows you to specify how many times the bell should
ring - anything between 0 and 15 times. Thus, you could create a batch
file to run a program and then ring the bell 1 time if the program was
successful and 15 times otherwise.
With the '-e' option you can ring the console bell conditional on the
previous program's return code. No matter what that program was, RING will
examine its return code and sound the console bell only if it is non-zero.
Further, it uses this return code as its own. Thus, the main difference
between "RING -e" and the batch command "if errorlevel 1 RING" is that the
first command preserves the value of ERRORLEVEL from the previous program
while the second does *not*. This lets you write cleaner batch files yet
still report errors. [NB: This option relies on undocumented "features" of
DOS and hence may not work on all versions of DOS. Please contact me if
you're not running DOS v3.30, v4.0, v5.0, or v6.0 but would still like to
use this option.]
If You Have Any Trouble
-----------------------
RING will let you know of any problems that arise. Here are the
messages you might see and how you should deal with them:
ring: invalid option -- x.
- Type "RING -?" for a list of valid options.
ring: invalid repetition count -- 100.
- The repetition count must be an unsigned integer
between 0 and 15. Note: RING reacts sensibly if
a count of 0 is specified.
ring: unable to locate errorlevel.
- Make sure you're using COMMAND.COM as the parent
shell and that it's from a supported version of
DOS.
These error messages are written to the standard error device. In this
way, they won't disappear down a pipe or into a file should you redirect
RING's output, although I can't imagine why you would ever do this.
Additionally, RING uses a return code to convey information about the
success or failure of its operation. Possible return values are:
Code Meaning
---- -------
0 Program completed successfully
1 Help message was displayed
if the '-e' option was *NOT* specified; otherwise, it equals whatever the
previous program's return code was. You can test for these codes using the
ERRORLEVEL variable in a batch file.
Requirements
------------
TifaWARE RING runs on machines operating under DOS v2.xx or later, and
requires less than 2K of memory! [NB: To use the '-e' option, you must be
operating DOS v3.30, v4.0, v5.0, or v6.0.] It uses standard DOS function
calls so it should work even on machines that are not PC-compatible.
Who Owns It?
------------
I am releasing this program into the public domain. Since 1984 I have
used public-domain software extensively, and I find it to be a terrific
idea. Most programs are useful, and the source instructive. And they cost
nothing! With this small contribution to the public domain I hope to pay
back my gratitude to those other programmers who have made my computing so
much easier.
However, this program carries no obligation on my part to support
users or provide future upgrades. I try to write clean code and believe it
is "bug-free". Nevertheless, use this program ***AT YOUR OWN RISK***. Scan
the source yourself, make any desired changes, and recompile the program,
if possible. Make this standard practice with newly-acquired software and
you'll not only protect your system from viruses but also get a better
feel for exactly how programs work!
As author of this program, I have two requests: First, please keep
together the original source code, documentation, and executable if you
distribute the package. This just makes it easier for others to use the
software. Second, let me hear what you think of it - I'd appreciate a
postcard with your comments. Enjoy!
Kudos
-----
Many thanks go to Borland for its stand-alone debugger, which greatly
reduced the time spent developing this program. Thanks are also due to
Josep Fortiana Gregori (D3ESJFG0@EB0UB011 on BITNET) who supplied a code
fragment suggesting how to find ERRORLEVEL in RAM and to Yan Juras for
pointing out where exactly to look.
George A. Theall
TifaWARE
610 South 48th St
Philadelphia, PA. 19143
U.S.A.
george@tifaware.com
theall@popmail.tju.edu
theall@mcneil.sas.upenn.edu
george.theall@satalink.com